Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add unit tests for AboutUs component #65

Merged
merged 13 commits into from
Mar 23, 2022

Conversation

Dripcoding
Copy link
Contributor

Add unit tests for AboutUs page

  • add unit tests for AboutUs
  • enable typescript for test files
  • apply formatting

@preetkaran20
Copy link
Member

Hi @Dripcoding ,

After the last commit which you made, one of the job is failing with error:

#10 37.35 > [email protected] postinstall /usr/src/app/node_modules/ejs
#10 37.35 > node ./postinstall.js
#10 37.35 
#10 37.40 Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)
#10 37.40 
#10 37.68 
#10 37.68 > [email protected] postinstall /usr/src/app/node_modules/es5-ext
#10 37.68 > node -e "try{require('./_postinstall')}catch(e){}"
#10 37.68 
#10 39.29 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/webpack-dev-server/node_modules/fsevents):
#10 39.29 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
#10 39.30 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/watchpack-chokidar2/node_modules/fsevents):
#10 39.30 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
#10 39.31 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
#10 39.31 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
#10 39.31 
#10 39.32 added 1805 packages from 765 contributors and audited 1813 packages in 30.964s
#10 40.29 
#10 40.29 159 packages are looking for funding
#10 40.29   run `npm fund` for details
#10 40.29 
#10 40.29 found 27 vulnerabilities (2 low, 9 moderate, 15 high, 1 critical)
#10 40.29   run `npm audit fix` to fix them, or `npm audit` for details
#10 DONE 42.7s

#11 [builder 6/7] COPY ./facade-app .
#11 DONE 0.0s

#12 [builder 7/7] RUN npm run build
#12 0.475 
#12 0.475 > [email protected] build /usr/src/app
#12 0.475 > react-scripts build
#12 0.475 
#12 2.021 Creating an optimized production build...
#12 26.12 Failed to compile.
#12 26.12 
#12 26.12 /usr/src/app/src/App.tsx
#12 26.12 TypeScript error in /usr/src/app/src/App.tsx(215,79):
#12 26.12 No overload matches this call.
#12 26.12   Overload 1 of 2, '(props: Props | Readonly<Props>): Footer', gave the following error.
#12 26.12     Type '{ children: string; globalState: GlobalState; setGlobalState: (globalState: GlobalState) => void; copyRightYear: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Footer> & Readonly<Props> & Readonly<{ children?: ReactNode; }>'.
#12 26.12       Property 'copyRightYear' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Footer> & Readonly<Props> & Readonly<{ children?: ReactNode; }>'.
#12 26.12   Overload 2 of 2, '(props: Props, context: any): Footer', gave the following error.
#12 26.12     Type '{ children: string; globalState: GlobalState; setGlobalState: (globalState: GlobalState) => void; copyRightYear: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Footer> & Readonly<Props> & Readonly<{ children?: ReactNode; }>'.
#12 26.12       Property 'copyRightYear' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Footer> & Readonly<Props> & Readonly<{ children?: ReactNode; }>'.  TS[276](https://github.com/SasanLabs/VulnerableApp-facade/runs/5639189602?check_suite_focus=true#step:3:276)9
#12 26.12 
#12 26.12     213 |           ></Content>
#12 26.12     214 |         </RSuiteContainer>
#12 26.12   > 215 |         <Footer globalState={this.state} setGlobalState={this.setGlobalState} copyRightYear={copyRightYear}>
#12 26.12         |                                                                               ^
#12 26.12     216 |           Footer
#12 26.12     217 |         </Footer>
#12 26.12     218 |       </RSuiteContainer>
#12 26.12 
#12 26.12 
#12 26.16 npm ERR! code ELIFECYCLE
#12 26.16 npm ERR! errno 1
#12 26.16 npm ERR! [email protected] build: `react-scripts build`
#12 26.16 npm ERR! Exit status 1
#12 26.16 npm ERR! 
#12 26.16 npm ERR! Failed at the [email protected] build script.
#12 26.16 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
#12 26.17 
#12 26.17 npm ERR! A complete log of this run can be found in:
#12 26.17 npm ERR!     /root/.npm/_logs/2022-03-22T05_42_13_[276](https://github.com/SasanLabs/VulnerableApp-facade/runs/5639189602?check_suite_focus=true#step:3:276)Z-debug.log
#12 ERROR: executor failed running [/bin/sh -c npm run build]: exit code: 1
------
 > [builder 7/7] RUN npm run build:
#12 26.16 npm ERR! code ELIFECYCLE
#12 26.16 npm ERR! errno 1
#12 26.16 npm ERR! [email protected] build: `react-scripts build`
#12 26.16 npm ERR! Exit status 1
#12 26.16 npm ERR! 
#12 26.16 npm ERR! Failed at the [email protected] build script.
#12 26.16 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
#12 26.17 
#12 26.17 npm ERR! A complete log of this run can be found in:
#12 26.17 npm ERR!     /root/.npm/_logs/2022-03-22T05_42_13_276Z-debug.log
------
error: failed to solve: executor failed running [/bin/sh -c npm run build]: exit code: 1
Error: buildx failed with: error: failed to solve: executor failed running [/bin/sh -c npm run build]: exit code: 1

can you please have a look and fix it.

thanks,
Karan

@Dripcoding
Copy link
Contributor Author

@preetkaran20 This PR contains the fix for the issue you mentioned. I've confirmed this by running npm run build locally. For the future, we might want to run the npm run build script upon opening PRs as well.

@preetkaran20
Copy link
Member

@preetkaran20 This PR contains the fix for the issue you mentioned. I've confirmed this by running npm run build locally. For the future, we might want to run the npm run build script upon opening PRs as well.

Right, we do that as well but now sure why it failed. Let me see that

@preetkaran20
Copy link
Member

added PR: #66 for handling npm run build in PR creation as well.

Copy link
Member

@preetkaran20 preetkaran20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow!!! Amazing work. LGTM.

One suggestion, please write a document that can help the future contributors on how to generate snapshots, write unit test cases, contribute to the Project and may be best practises.

@preetkaran20 preetkaran20 merged commit fcd09d0 into SasanLabs:main Mar 23, 2022
@preetkaran20
Copy link
Member

@Dripcoding Invited you to core-vulnerableapp-ui github team.

thanks,
Karan

@Dripcoding
Copy link
Contributor Author

@preetkaran20 thanks Karan! I'm happy to contribute to the project :) I've opened this issue for documentation #67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants